# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-webcolors
_pkgname=webcolors
pkgver=1.13
pkgrel=2
pkgdesc="A library for working with color names and color value formats"
url="https://github.com/ubernostrum/webcolors"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools py3-wheel py3-gpep517 py3-installer"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-webcolors" # Backwards compatibility
provides="py-webcolors=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH=src pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/webcolors*.whl
}

sha512sums="
074aaf135ac6b0025b88b731d1d6dfa4c539b4fff7195658cc58a4326bb9f0449a231685d312b4a1ec48ca535a838bfa5c680787fe0e61473a2a092c448937d0  webcolors-1.13.tar.gz
"
